import request from '#/utils/requestAbort';
import { OPTION_KEY } from './components/PROVINCE_SX/helper';
//黑龙江、陕西
export const useNewServers = ['PDBLJ', 'PXBSX'];

export async function querySpotResumeAnalysisOverall(data) {
  return request(`/reanalyze/spotResumeAnalysisData/spotResumeAnalysisOverall`, {
    method: 'post',
    data,
  });
}

// 山东灵活聚合查询
export async function spotResumptionInProvince(params) {
  return request('/reanalyze/spotResumeAnalysisData/spotResumptionInProvince', {
    method: 'POST',
    data: params,
  });
}

// 山西灵活聚合接口
export async function getSpotResumeAnalysisDataNew(data) {
  data.flexAggrBody.order = data?.flexAggrBody?.order.map((t) => OPTION_KEY[t]);
  data.flexAggrBody.headType = 1;
  return request('/reanalyze/spotResumeAnalysisData/v2/spotResumptionInProvince', {
    method: 'post',
    data,
  });
}

// 省份-交易中心-场站（数据权限）
export async function queryMarketList(menuCode) {
  return request(`/power/dataPower/common/${menuCode}/t_station`, {
    method: 'GET',
  });
}

// 黑龙江灵活聚合接口
export async function hljSpotResumeAnalysisDataNew(data) {
  data.flexAggrBody.order = data?.flexAggrBody?.order.map((t) => OPTION_KEY[t]);
  data.flexAggrBody.headType = 1;
  // return request('/private-business/spotResumeAnalysisData/v2/spotResumptionInProvince', {
  //   method: 'post',
  //   data,
  // });
  return request('/private-business/provincialSpotReplay/getReanalyzeData', {
    method: 'post',
    data,
  });
}

// 黑龙江汇总接口
export async function hljSpotResumeAnalysisOverall(data) {
  // return request(`/private-business/spotResumeAnalysisData/spotResumeAnalysisOverall`, {
  //   method: 'post',
  //   data,
  // });
  return request(`/private-business/provincialSpotReplay/getAnalysisOverAll`, {
    method: 'post',
    data,
  });
}
